home *** CD-ROM | disk | FTP | other *** search
- Dim ctop As Integer
- Dim cleft As Integer
- Dim cright As Integer
- Dim cbottom As Integer
-
- Const DarkGray = 8421504
- Const FullWhite = 16777215
-
- Sub Outlines (formname As form)
- On Error Resume Next
-
- Dim i As Integer
- Dim cname As Control
-
- ' Outline a form's controls for 3D look if the control's TAG
- ' property is set to "OLR" for raised and "OLS" for sunken.
- For i = 0 To (formname.Controls.Count - 1)
- Set cname = formname.Controls(i)
- If (UCase(cname.Tag) = "OLS") Then
- If cname.Visible = True Then
- ctop = cname.Top - Screen.TwipsPerPixelY
- cleft = cname.Left - Screen.TwipsPerPixelX
- cright = cname.Left + cname.Width
- cbottom = cname.Top + cname.Height
- formname.Line (cleft, ctop)-(cright, ctop), DarkGray
- formname.Line (cleft, ctop)-(cleft, cbottom), DarkGray
- formname.Line (cleft, cbottom)-(cright, cbottom), FullWhite
- formname.Line (cright, ctop)-(cright, cbottom), FullWhite
- End If
- ElseIf (UCase(cname.Tag) = "OLR") Then
- If cname.Visible = True Then
- ctop = cname.Top - Screen.TwipsPerPixelY
- cleft = cname.Left - Screen.TwipsPerPixelX
- cright = cname.Left + cname.Width
- cbottom = cname.Top + cname.Height
- formname.Line (cleft, ctop)-(cright, ctop), FullWhite
- formname.Line (cleft, ctop)-(cleft, cbottom), FullWhite
- formname.Line (cleft, cbottom)-(cright, cbottom), DarkGray
- formname.Line (cright, ctop)-(cright, cbottom), DarkGray
- End If
- End If
- Next i
- End Sub
-
- Sub PicOutlines (pic As Control, ctl As Control)
- On Error Resume Next
-
- ' Outline a container control for 3D look if the control's TAG
- ' property is set to "OLR" for raised and "OLS" for sunken.
- If ctl.Visible = False Then Exit Sub
-
- ctop = ctl.Top - Screen.TwipsPerPixelY
- cleft = ctl.Left - Screen.TwipsPerPixelX
- cright = ctl.Left + ctl.Width
- cbottom = ctl.Top + ctl.Height
- If ctl.Tag = "POLS" Then
- pic.Line (cleft, ctop)-(cright, ctop), DarkGray
- pic.Line (cleft, ctop)-(cleft, cbottom), DarkGray
- pic.Line (cleft, cbottom)-(cright, cbottom), FullWhite
- pic.Line (cright, ctop)-(cright, cbottom), FullWhite
- ElseIf ctl.Tag = "POLR" Then
- pic.Line (cleft, ctop)-(cright, ctop), FullWhite
- pic.Line (cleft, ctop)-(cleft, cbottom), FullWhite
- pic.Line (cleft, cbottom)-(cright, cbottom), DarkGray
- pic.Line (cright, ctop)-(cright, cbottom), DarkGray
- End If
-
- End Sub
-
-